/**
 * 角色管理
 */

import { get, post, put, repost } from '../../http'

// 页面表格（角色列表）
const roleTableDataAPI = (params) => get('/role/roleList', params)
// 新增角色
const addRoleAPI = (params) => post('/role', params)
// 修改角色
const updateRoleAPI = (roleId, params) => put('/role/' + roleId, params)
// 配置角色用户
const configUserRoleAPI = (params) => post('role/configUserRole', params)
// 配置角色菜单
const configMenuRoleAPI = (params) => repost('/role/configRoleMenu', params)
// 启用、禁用
const roleEnableAPI = (url, params) => put('/role/' + url, params)
// 获取角色菜单
const roleMenuAPI = (params) => get('/menu/role/menuList', params)
// 获取已配置和未配置用户列表
const configUserListAPI = (params) => get('/user/role/userList', params)

export default {
  roleTableDataAPI,
  addRoleAPI,
  updateRoleAPI,
  configUserRoleAPI,
  configMenuRoleAPI,
  roleEnableAPI,
  roleMenuAPI,
  configUserListAPI
}
